<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/es-toolkit@%5E1"></script>
</head>
<body>
  <div id="Application">
    <button @click="click">按钮</button>
    <button @click="click2">按钮2</button>
  </div>

  <script>
    const { createApp, ref } = Vue;
    var throttle = false
    function throttleTool(callback, timeout) {
      if (throttle) return
      callback()
      throttle = true
      setTimeout(() => {
        throttle = false
      }, timeout);
    }
    let config = {
      setup() {
        const click = () => {
          throttleTool(() => {
            console.log(Date());
          }, 2000)
        }
        const throttledFunction = _.throttle(() => {
          console.log(Date());
        }, 2000)
        const click2 = () => {
          throttledFunction()
        }
        return {click, click2};
      },
    };
    createApp(config).mount("#Application");
  </script>
</body>
</html>